{if $full_page}
<!-- $Id: wxch_users_list.html 2013-12-1 Z djks $ -->
{include file="wxch_pageheader.htm"}
{insert_scripts files="../data/static/js/utils.js"}
<script type="text/javascript" src="js/listtable.js"></script>
<div class="form-div">	
    <form action="javascript:searchUser()" name="searchForm">
        <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />		<!--
        &nbsp;{$lang.label_rank_name} <select name="user_type"><option value="nickname" selected="selected">昵称</option><option value="province">省份</option><option value="city">城市</option></select>		
        &nbsp;昵称&nbsp;<input type="text" name="keyword" /> <input type="submit" value="{$lang.button_search}" />		-->		<select  name="scene_id"  >				<option value="-1">--</option>				<option value="0">平台</option>				{foreach from=$scene item=sce}				<option value="{$sce.scene_id}">{$sce.scene}</option>				{/foreach}		</select>		昵称 <input type="text" name="nickname" id="nickname" />		<input type="submit" value="{$lang.button_search}" class="button" />		
    </form>	
</div>
<style>
    .nickname{padding-left: 5px;}
</style>
<form method="POST" action="" name="listForm" onsubmit="return confirm_bath()">

    <!-- start users list -->
    <div class="list-div" id="listDiv">
        {/if}
        <!--用户列表部分-->
        <table cellpadding="3" cellspacing="1">
            <tr>
                <th>
                  
                    <a href="javascript:listTable.sort('uid'); ">编号</a>
                </th>
                <th>昵称</th>
                <!--<th>会员名称</th>-->
                 <!--<th>绑定会员</th>-->								<th>来源</th>				
                <th>性别</th>
                <th>省份</th>
                <th>城市</th>
                <th>关注时间</th>
                <th>操作</th>
            <tr>
                {foreach from=$user_list item=user}
            <tr>
                <td align="center">{$user.uid}</td>
                <td align="center">
                    {if $user.headimgurl }<img src="{$user.headimgurl}" title="{$user.nickname}" width="46" /><span class="nickname">{$user.nickname}</span>{else}{$user.nickname} {/if}
                </td>
                <!--<td align="center">{$user.ec_user_name}</td>-->
                <!--<td align="center">{$user.user_name}</td>-->								 <td align="center">{$user.scene}</td>				
                <td align="center">{$user.sex}</td>
                <td align="center">{$user.province}</td>
                <td align="center">{$user.city}</td>
                <td align="center">{$user.subscribe_time}</td>
                <td align="center">
                    <a href="wxch_users.php?act=view&uid={$user.uid}" ><img src="images/icon_view.gif" border="0" height="16" width="16" /></a>
                    <a href="wxch_users.php?act=send&uid={$user.uid}" ><img src="images/icon_title.gif" border="0" height="16" width="16" /></a>										<a href="javascript:getUserInfo('{$user.wxid}')" ><img src="images/loader.gif" border="0" height="16" width="16" /></a>
                </td>
            </tr>
            {/foreach}
            <tr>
                <td align="right" nowrap="true" colspan="8">
                    <div id="turn-page">
                        总计  <span id="totalRecords">{$filter.record_count}</span>
                        个记录分为 <span id="totalPages">{$filter.page_count}</span>
                        页当前第 <span id="pageCurrent">{$filter.page}</span>
                        页，每页 <input type='text' size='3' name="page_size" id='pageSize' value="{$filter.page_size}" onkeypress="return listTable.changePageSize(event)" />
        <span id="page-link">
          <a href="javascript:listTable.gotoPageFirst()">第一页</a>
          <a href="javascript:listTable.gotoPagePrev()">上一页</a>
          <a href="javascript:listTable.gotoPageNext()">下一页</a>
          <a href="javascript:listTable.gotoPageLast()">最末页</a>
          <select id="gotoPage" onchange="listTable.gotoPage(this.value)">
              {create_pages count=$filter.page_count page=$filter.page}
          </select>
       </span>
                    </div>
                </td>
            </tr>
        </table>

        {if $full_page}
    </div>
    <!-- end users list -->
</form>
<script type="text/javascript" language="JavaScript">
    <!--
    listTable.recordCount = {$record_count};
    listTable.pageCount = {$page_count};

    {foreach from=$filter item=item key=key}
    listTable.filter.{$key} = '{$item}';
    {/foreach}

    {literal}
    onload = function()
    {
        document.forms['searchForm'].elements['keyword'].focus();
        // 开始检查订单
        //startCheckOrder();
    }

    /**
     * 搜索用户
     */
    function searchUser()
    {
        listTable.filter['scene_id'] = Utils.trim(document.forms['searchForm'].elements['scene_id'].value);        listTable.filter['nickname'] = Utils.trim(document.forms['searchForm'].elements['nickname'].value);
      //  listTable.filter['type'] = document.forms['searchForm'].elements['user_type'].value;
        listTable.filter['page'] = 1;
        listTable.loadList();
    }
		function getUserInfo(wxid)	{		var url = "wxch_users.php";			//		$.post(url,data,function(res){//			//			alert(res);//		},'text');		 Ajax.call(url, "act=get_user&wxid="+wxid, userCallback, "POST", "TEXT", false);					}		function userCallback(result)	{		if(result=="ok")		{			alert("刷新微信用户信息成功");		}		else		{			alert("刷新微信用户信息失败");		}			}
    function confirm_bath()
    {
        userItems = document.getElementsByName('checkboxes[]');

        cfm = '{$lang.list_remove_confirm}';

        for (i=0; userItems[i]; i++)
        {
            if (userItems[i].checked && userItems[i].notice == 1)
            {
                cfm = '{$lang.list_still_accounts}' + '{$lang.list_remove_confirm}';
                break;
            }
        }

        return confirm(cfm);
    }
    //-->
</script>

{/literal}
{include file="wxch_pagefooter.htm"}
{/if}